<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml"
      xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>大区销售目标预测</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--插件样式-->
    <link rel="stylesheet" href="/dist/plugins/select2/select2.min.css">
    <link rel="stylesheet" href="/dist/plugins/fixedTable/fixed-table.css"/>
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=39cd89cd">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <style>
        .table > tbody > tr > td {
            height: 30px;
            max-height: 44px;
            overflow: hidden;
            padding: 0 2px;
            border: 1px #cbcbcd solid
        }

        .table > thead > tr > th {
            border: 1px #cbcbcd solid
        }

        tbody {
            font-size: 12px;
        }

        .saveModle {
            width: 500px;
            height: 300px;
            position: fixed;
            top: 50%;
            left: 50%;
            margin-left: -250px;
            margin-top: -150px;
            background: #fff;
            border-radius: 10px;
            z-index: 1978;
            display: none;
            border: 1px solid #cfcfcf;
        }

        .saveModle .top {
            height: 34px;
            line-height: 34px;
            font-size: 14px;
            font-weight: bold;
            color: #333;
            padding-left: 7px;
            border-bottom: 1px solid #cfcfcf;
            background: #fff;
        }

        .saveModle .top .title {
            height: 32px;
            line-height: 32px;
            font-size: 14px;
            font-weight: bold;
            color: #333;
            float: left;
            background: #fff;
        }

        .saveModle .top .btn {
            font-size: 20px;
            width: 34px;
            height: 22px;
            line-height: 12px;
            display: inline-block;
            float: right;
        }

        .saveModle .top .btn:hover {
            color: red;
        }

        .saveModle .saveBtn {
            margin: 0 auto;
            margin-top: 35px;
            display: block;

        }

        .lineOne {
            max-height: 36px;
            line-height: 18px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 3;
        }

        p {
            display: inline-block;
            float: left;
            margin-bottom: 0px;
            line-height: 25px;
            padding-right: 15px;
            color: #228bee;
            font-size: 14px;
        }

        .td-value span.lineOne {
            overflow: hidden;
            text-overflow: ellipsis;
            color: black !important;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            max-height: 48px;
            line-height: 29px;
        }

        .td-value {
            text-align: left !important;
            vertical-align: middle;
            word-wrap: break-word;
            color: black !important;
        }

        .td-value span {
            display: inline-block;
            overflow: hidden;
            padding-left: 0.06rem;
            word-wrap: break-word;
            color: black !important;
        }

        .fixed-table_body tr td {
            border-right: none;
        }

        .fixed-table_header tr th {
            border-right: none;
            background: yellow;
            font-weight: normal;
            font-size: 12px;
        }

        .description {
            display: flex;
            flex-wrap: wrap;
            justify-content: flex-start;
            width: 244px;
            /* margin-left: 395px; */
            /* padding-top: 50px; */
            /* float: right; */
            position: absolute;
            top: -10px;
            right: 0px;
        }

        .mubiao {
            display: block;
            /* justify-content: flex-start; */
            /* position: absolute; */
            /* top: 60px; */
            /* right: 255px; */
            margin: 0 auto;
            height: 60px;
            width: 350px
        }

        .title {
            background: #F8F8F8 !important;
        }

        .text-center td {
            background: #fff;
        }

        .content {
            padding: 0px 0px 15px 20px;
            padding-bottom: 0;
        }

        #tbList tr td {
            height: 42px !important;
        }

        .fixed-table-box td {
            position: static;
        }

        .fixed-table-box .fixed-table_body td {
            border-left: 1px solid #cbcbcd;
        }

        html, body, #app {
            padding: 0px;
            margin: 0px;
        }

        .fixed-table-box:before {
            height: 0px;
        }

        .fixed-table-box:after {
            width: 0px;
        }

        .fixed-table-box th {
            position: relative;
            text-align: center;
            height: 36px;
            border: 1px solid #cbcbcd;
        }

        .has-feedback {
            position: absolute;
            left: 0px;
            top: 0px;
        }

        .table {
            width: 100%;
            max-width: 100%;
            margin-bottom: 0px;
        }

        .has-feedback .form-control {
            padding-right: 0px;
        }

        .duiqi {
            text-align: justify;
            display: inline-block;
            overflow: hidden;
            vertical-align: middle;
            height: 24px;
            line-height: 24px;
            width: 36px;
        }
    </style>
</head>
<body>
<div class="oaLoad">
    <div class="loadGif" id="areaProgress"></div>
</div>
<section class="content" id="app" v-cloak>
    <div class="div-td-content-more"><i></i></div>
    <iframe id="ifExprot" style="width:0px;height:0px;display: none;" frameborder="0"></iframe>
    <div style="height: 65px;margin-bottom: 10px;position: relative;margin-top: 10px">
        <div class="mubiao">
            <table class="table text-center table-striped" style="width: 150px;float:left;">
                <thead>
                <tr>
                    <th style="width: 75px;" class="title">当月目标</th>
                    <th class="title">已完成</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td>{{targetSum}}</td>
                    <td>{{finishSum}}</td>
                </tr>
                </tbody>
            </table>
            <table class="table  text-center table-striped" style="width: 185px;border-left: none;">
                <thead>
                <tr>
                    <th style="width: 75px;border-left: none;" class="title">成交总概率</th>
                    <th class="title">超75%成交总概率</th>
                    <!--<th style="width: 80px;" class="title">目标完成比对</th>-->
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td style="color: red;border-left: none;">{{scale(allChance)}}%</td>
                    <td style="color: red;">{{scale(overSevenChance)}}%</td>
                    <!--<td style="color: red;">{{scale()}}%</td>-->
                </tr>
                </tbody>
            </table>
        </div>
        <div class="description">
            <span style="color: red;font-size: 15px">成交概率说明</span>
            <span>100%:已发车在途，信审通过待发车等情况</span>
            <span>75%:认可设备，但时间不确定或资金未到</span>
            <span>50%:有竞争对手、工程未确定、合伙人未定等</span>
        </div>
        <div class="nav-tabs-custom oaReportNav" style="margin:10px 0px;">
            <div class="has-feedback">
                <div class="pull-left" style="margin-top: 15px">
                    <select id="testState" v-model="buyDateYc" class="form-control"
                            style="height:26px;width: 130px;font-size:12px;line-height:25px;padding-top:0px;padding-bottom:0px;padding-left:6px;">
                        <!--@change="search()"-->
                        <option selected value="">请选择购买时间</option>
                        <option selected value="本月内">本月内</option>
                        <option selected value="下月内">下月内</option>
                    </select>
                </div>
                <input type="text" id="likeSelect" class="form-controll pull-left input-sm"
                       style="width: 130px;height: 25px;margin-left: 5px;margin-top: 15px" v-model="keyYc"
                       placeholder="请输入关键字"
                       size="12">
                <span id="btnQuery" class="glyphicon glyphicon-search form-control-feedback"
                      style="display:none "></span>
                <input type="button" class="btn oaBtn pull-left btn-sm" style="margin-left: 10px;margin-top: 15px;min-width: 60px;"
                       value="查询"
                       class="oaBtn" @click="getBigRegionSaleTargetYc()">
            </div>
        </div>
    </div>
    <div class="box-body no-padding" style="overflow: auto;margin-top: 10px;" id="scrollDiv">
        <div id="progress" class="wyui-progress"></div>
        <div class="fixed-table-box row-col-fixed" style="border-left: 0px;border-right: 0px;">
            <!-- 表头 start -->
            <div class="fixed-table_header-wraper">
                <table class="fixed-table_header" cellspacing="0" cellpadding="0" border="0"
                       style="width: 100% !important;">
                    <thead>
                    <tr>
                        <th style="width: 30px">
                            序号
                        </th>
                        <th style="width: 55px">
                            大区
                        </th>
                        <th style="width: 80px">
                            区域
                        </th>
                        <th style="width: 46px">
                            区域<br>经理
                        </th>
                        <th style="width: 46px">
                            客户<br>姓名
                        </th>
                        <th style="width: 60px">
                            意向<br>机型
                        </th>
                        <th style="width: 60px">
                            购买<br>时间
                        </th>
                        <th style="width: 60px;">
                            成交<br>概率
                        </th>
                        <th style="width: 200px;">
                            最新跟踪
                        </th>
                        <th style="width: 75px;">
                            新机报价<br>(万)
                        </th>
                        <th style="width: 60px;">
                            限价<br>(万)
                        </th>
                        <th style="width: 75px;">
                            心里价格<br>(万)
                        </th>
                        <th style="width: 120px;">
                            现有<br>设备
                        </th>
                        <th style="width: 60px;">
                            是否<br>置换
                        </th>
                        <th style="width: 75px;">
                            置换品牌<br>机型
                        </th>
                        <th style="width: 60px;">
                            评估价<br>(万)
                        </th>
                        <th style="width: 75px;">
                            客户要价<br>(万)
                        </th>
                        <th style="width: 60px;">
                            付款<br>方式
                        </th>
                        <th style="width: 60px;">
                            首付<br>比例
                        </th>
                        <th style="width: 60px;">
                            定金<br>状态
                        </th>
                        <th style="width: 75px;">
                            定金金额<br>(万)
                        </th>
                        <th style="width: 100px;">
                            首付预计<br>收款日期
                        </th>
                        <th style="width: 75px;">
                            收款金额<br>(万)
                        </th>
                        <th style="width: 80px">
                            预计成交<br>时间
                        </th>
                        <!-- <th style="width: 60px">
                             报价
                         </th>
                         <th style="width: 60px">
                             心理价格
                         </th>-->
                        <!--<th>-->
                        <!--今日跟踪情况-->
                        <!--</th>-->
                        <!--<th style="width: 200px">-->
                        <!--昨日跟踪情况-->
                        <!--</th>-->
                        <th style="width: 60px;">
                            更新<br>状态
                        </th>
                        <th style="width: 17px;border-right: 1px solid #cbcbcd;"></th>
                    </tr>
                    </thead>
                </table>
            </div>
            <!--内容-->
            <div class="fixed-table_body-wraper iframeDQXSYC">
                <table cellspacing="0" cellpadding="0" border="0"
                       style="width: 100%;border-right: 1px solid #cbcbcd;">
                    <tbody id="tbList">
                    <tr v-for="(item,i) in list">

                        <td style="width: 30px;text-align: center;">
                            <div class="table-cell">{{i+1}}</div>
                        </td>
                        <td style="width: 55px;text-align: center;"
                            :rowspan="item.bigManagerRegionNamespan"
                            :class="{hidden: item.bigManagerRegionNamedis}">
                            {{item.bigManagerRegionName.substring(0,item.bigManagerRegionName.length-2)}}<br>大区</span>

                        </td>
                        <td style="width: 80px;text-align: center;"
                            :rowspan="item.managerRegionNamespan"
                            :class="{hidden: item.managerRegionNamedis}">
                            <div class="table-cell" style="height: 36px"><span class="lineOne" style="text-align: left;">{{item.managerRegionName}}</span></div>
                        </td>
                        <td style="width: 46px;text-align: center;border-right-width:0px;"
                            :rowspan="item.managerRegionNamespan"
                            :class="{hidden: item.managerRegionNamedis}">
                            <div class="table-cell">    <span class="duiqi">
                                                {{item.managerName}}<i
                                    style="display: inline-block;width: 100%;height: 0;"></i>
                                            </span></div>
                        </td>
                        <td style="width: 46px;text-align: center;">
                            <div class="table-cell">
                                <span @click="openDetail(item,0)" class="duiqi"
                                      style="color: rgb(42, 140, 236);cursor:pointer;">
                                                {{item.customerName}}<i
                                        style="display: inline-block;width: 100%;height: 0;"></i>
                                            </span>
                            </div>
                        </td>
                        <td style="width: 60px;text-align: center;" class="td-value">
                            <div class="table-cell"><span class="lineOne">{{item.intentionModel}}</span></div>
                        </td>
                        <td style="width: 60px;text-align: center;" class="td-value">
                            <div class="table-cell"><span class="lineOne">{{item.buyDate}}</span></div>
                        </td>
                        <td style="width: 60px;text-align: center;" class="td-value">
                            <div class="table-cell"><span class="lineOne">{{item.chance}}</span></div>
                        </td>
                        <td style="width: 200px;">
                            <div class="table-cell" style="height: 36px;"><span class="lineOne"
                                                                                style="text-align: left">{{item.otherCondition}}</span>
                            </div>
                        </td>
                        <td style="width: 75px;text-align: center;" class="td-value">
                            <div class="table-cell"><span class="lineOne">{{item.quote}}</span></div>
                        </td>
                        <td style="width: 60px;text-align: center;" class="td-value">
                            <div class="table-cell"><span class="lineOne">{{item.limitedPrice}}</span></div>
                        </td>
                        <td style="width: 75px;text-align: center;" class="td-value">
                            <div class="table-cell"><span class="lineOne">{{item.psychologicalPrice}}</span></div>
                        </td>
                        <td style="width: 120px;" >
                            <div class="table-cell" style="height: 36px;"><span class="lineOne"
                                                                                style="text-align: left">{{item.exisTingDevice}}</span>
                            </div>
                        </td>
                        <td style="width: 60px;text-align: center;" class="td-value">
                            <div class="table-cell"><span class="lineOne" v-if="item.ifReplace=='1'">是</span>
                                <span class="lineOne" v-if="item.ifReplace=='0'">否</span></div>
                        </td>
                        <td style="width: 75px;text-align: center;" class="td-value">
                            <div class="table-cell"><span class="lineOne">{{item.replaceType}}</span></div>
                        </td>
                        <td style="width: 60px;text-align: center;" class="td-value">
                            <div class="table-cell"><span class="lineOne">{{item.valuationPrice}}</span></div>
                        </td>
                        <td style="width: 75px;text-align: center;" class="td-value">
                            <div class="table-cell"><span class="lineOne">{{item.customerAsk}}</span></div>
                        </td>
                        <td style="width: 60px;text-align: center;" class="td-value">
                            <div class="table-cell"><span class="lineOne">{{item.buyType}}</span></div>
                        </td>
                        <td style="width: 60px;text-align: center;" class="td-value">
                            <div class="table-cell"><span class="lineOne">{{item.paymentRatio}}</span></div>
                        </td>
                        <td style="width: 60px;text-align: center;" class="td-value">
                            <div class="table-cell"><span class="lineOne">{{item.earnestStatus}}</span></div>
                        </td>
                        <td style="width: 75px;text-align: center;" class="td-value">
                            <div class="table-cell"><span class="lineOne">{{item.earnestMoney}}</span></div>
                        </td>
                        <td style="width: 100px;text-align: center;" class="td-value">
                            <div class="table-cell"><span class="lineOne">{{item.paymentDate}}</span></div>
                        </td>
                        <td style="width: 75px;text-align: center;" class="td-value">
                            <div class="table-cell"><span class="lineOne">{{item.amountCollect}}</span></div>
                        </td>
                        <td style="width: 80px;text-align: center;" class="td-value">
                            <div class="table-cell"><span class="lineOne">{{item.yjOkDate}}</span></div>
                        </td>
                        <!--<td style="width: 60px;text-align: center;">
                            <div class="table-cell">{{item.quote}}</div>
                        </td>
                        <td style="width: 60px;text-align: center;">
                            <div class="table-cell">{{item.psychologicalPrice}}</div>
                        </td>-->
                        <!--<td>-->
                        <!--<div class="table-cell" style="height: 48px;"><span class="lineOne"-->
                        <!--style="text-align: left;">{{item.otherCondition}}</span>-->
                        <!--</div>-->
                        <!--</td>-->
                        <!--<td style="width: 254px;text-align: center;">-->
                        <!--<div class="table-cell" style="height: 48px;"><span class="lineOne"-->
                        <!--style="text-align: left;">{{item.yesterdayOtherCondition}}</span>-->
                        <!--</div>-->
                        <!--</td>-->
                        <td style="width: 60px;text-align: center;" class="td-value">
                            <div class="table-cell"><span class="lineOne" :style="item.state=='已更新'?'color :red !important;':''">{{item.state}}</span></div>
                        </td>
                        <template v-if="list.length>=10">
                            <td style="width: 0px;border-left: 0px;"></td>
                        </template>
                        <template v-else>
                            <td style="width: 17px;border-left: 0px;"></td>
                        </template>
                    </tr>
                    </tbody>
                </table>
            </div>
            <!--固定列-->
            <div class="fixed-table_fixed fixed-table_fixed-left">
                <div class="fixed-table_header-wraper nofix">
                    <table class="fixed-table_header" style="border-right:1px solid #d3e8fd;" cellspacing="0"
                           cellpadding="0" border="0">
                        <thead>
                        <tr>
                            <th style="width: 30px">
                                序号
                            </th>
                            <th style="width: 55px">
                                大区
                            </th>
                            <th style="width: 80px">
                                区域
                            </th>
                            <th style="width: 46px;border-right-width:0px;">
                                区域<br>经理
                            </th>
                        </tr>
                        </thead>
                    </table>
                </div>
                <div class="fixed-table_body-wraper iframeDQLeftXSYC">
                    <table class="fixed-table_body" cellspacing="0" cellpadding="0" border="0"
                           style="border-right:1px solid #cbcbcd;">
                        <tbody id="tbList">
                        <tr v-for="(item,i) in list">

                            <td style="width: 30px;text-align: center;">
                                <div class="table-cell">{{i+1}}</div>
                            </td>
                            <td style="width: 55px;text-align: center;"
                                :rowspan="item.bigManagerRegionNamespan"
                                :class="{hidden: item.bigManagerRegionNamedis}">
                                {{item.bigManagerRegionName.substring(0,item.bigManagerRegionName.length-2)}}<br>大区

                            </td>
                            <td style="width: 80px;text-align: center;"
                                :rowspan="item.managerRegionNamespan"
                                :class="{hidden: item.managerRegionNamedis}">
                                <div class="table-cell" style="height: 36px"><span class="lineOne" style="text-align: left;">{{item.managerRegionName}}</span></div>
                            </td>
                            <td style="width: 46px;text-align: center;border-right-width:0px;"
                                :rowspan="item.managerRegionNamespan"
                                :class="{hidden: item.managerRegionNamedis}">
                                <div class="table-cell">    <span class="duiqi">
                                                {{item.managerName}}<i
                                        style="display: inline-block;width: 100%;height: 0;"></i>
                                            </span></div>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=7e54a132"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=54c6b89c"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script src="/dist/plugins/webuploader-0.1.5/webuploader.min.js"></script>
<script src="/dist/plugins/fixedTable/fixed-table.js"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne,.lineTwo", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + 12 + "px",
                        "left": $(this).offset().left - 6,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script>
    $.xhrPool = [];
    $.xhrPool.abortAll = function () {
        $(this).each(function (idx, jqXHR) {
            console.log(idx, jqXHR);
            jqXHR.abort();
        });
        $.xhrPool = [];
    };
</script>
<script type="text/javascript">
    function refresh() {
        $.wyui.page.getByPage();
    }

    var app = new Vue({
        el: '#app',
        data: {
            targetSum: 0,
            finishSum: 0,
            allChance: 0,
            keyYc: '',
            buyDateYc: '',
            overSevenChance: 0,
            currentUser: getCurrentUser(),
            list: [],
        },
        methods: {
            changeBuyDate: function (buyDate) {
                var a = '';
                switch (buyDate) {
                    case 'todayMonth':
                        a = '本月内'
                        break
                    case 'nextMonth':
                        a = '下月内'
                        break
                    case 'threeMonth':
                        a = '三月内'
                        break
                    case 'halfYear':
                        a = '半年内'
                        break
                }
                return a;
            },
            stopAjax: function () {

                if ($.xhrPool && $.xhrPool.length > 0) {
                    $.xhrPool.abortAll();
                    $.xhrPool.abortAll = function () {
                        $(this).each(function (idx, jqXHR) {
                            console.log(idx, jqXHR);
                            jqXHR.abort();
                        });
                        $.xhrPool = [];
                    };
                } else {
                    console.log("没有需要关闭的ajax")
                }
            },
            tablesMergeCell: function (list) {
                for (field in list[0]) {
                    var k = 0;
                    while (k < list.length) {
                        list[k][field + 'span'] = 1;
                        list[k][field + 'dis'] = false;
                        for (var i = k + 1; i <= list.length - 1; i++) {
                            if (list[k][field] == list[i][field] && list[k][field] != '' || list[k][field] == 0 && list[i][field] == 0) {
                                if (field == 'bigRegionName') {
                                    if (list[k].departName == list[i].departName) {
                                        list[k][field + 'span']++;
                                        list[k][field + 'dis'] = false;
                                        list[i][field + 'span'] = 1;
                                        list[i][field + 'dis'] = true;
                                    }
                                } else if (field == 'childRegionName') {
                                    if (list[k].departName == list[i].departName && list[k].bigRegionName == list[i].bigRegionName) {
                                        list[k][field + 'span']++;
                                        list[k][field + 'dis'] = false;
                                        list[i][field + 'span'] = 1;
                                        list[i][field + 'dis'] = true;
                                    }
                                } else {
                                    list[k][field + 'span']++;
                                    list[k][field + 'dis'] = false;
                                    list[i][field + 'span'] = 1;
                                    list[i][field + 'dis'] = true;
                                }
                            } else {
                                break;
                            }
                        }
                        k = i;
                    }
                }
                return list;
            },
            openDetail: function (item, isAdd) {
                var that = this;
                var url = '/page/intentionManagement/quYuIntentionalDetailApp.html?customerId=' + item.customerId + '&isAdd=' + isAdd + '&pageType=edit&userId=' + getCurrentUser().id + '&companyId=' + that.companyId + '&isRegion=1&type=pcbb';
                var H = $(window).height() - 50;
                $.dialog({
                    content: 'url:' + url,
                    title: "意向客户详情",
                    width: 500,
                    height: H,
                    max: true,
                    min: true,
                    lock: true
                });
            },
            getCustomerVisit: function (index) {
                var that = this;
                var item = that.list[index];
                if (!item.customerId || item.customerId == '') {
                    item.todayOtherCondition = '';
                    item.yesterdayOtherCondition = '';
                } else {
                    $.ajax({
                        url: server.ip + '/depConfig/getCustomerVisit.json',
                        contentType: 'application/json;charset=utf-8',
                        type: "POST",
                        data: JSON.stringify({
                                createUserId: item.quyuId,
                                customerId: item.customerId
                            }
                        ),
                        beforeSend: function (jqXHR) {
                            $.xhrPool.push(jqXHR);
                        }, complete: function (jqXHR) {
                            var index = $.xhrPool.indexOf(jqXHR);
                            if (index > -1) {
                                $.xhrPool.splice(index, 1);
                            }
                        },
                        error: function () {
                            console.log('error')
                        },
                        success: function (r) {
                            var r = r.data.sendData
                            that.list[index].todayOtherCondition = r.result.todayOtherCondition;
                            that.list[index].yesterdayOtherCondition = r.result.yesterdayOtherCondition;
                        },
                    })

                }
            },

            scale: function (num) {
                var that = this;
                if ((Number(that.targetSum) - Number(that.finishSum)) == 0) {
                    return 0
                } else {
                    console.log(Number(num), (Number(that.targetSum) - Number(that.finishSum)))
                    return (Number(num) / (Number(that.targetSum) - Number(that.finishSum))).toFixed(2)

                }
            },
            isToday: function (i) {
                var that = this;
                var item = that.list[i];
                if (!item.customerId || item.customerId == '') {
                    that.list[i].state = '';
                } else {
                    if (item.createTime && item.createTime != '') {
                        if (item.createTime.substring(0, 10) == this.getNowDate()) {
                            that.list[i].state = "今日新增"
                        } else {
                            if (item.updateTime && item.updateTime != '' && item.updateTime.substring(0, 10) == this.getNowDate()) {
                                var intentionFlag = 0;
                                $.ajax({
                                    url: server.ip + '/depConfig/getIntentCustomerState.json',
                                    contentType: 'application/json;charset=utf-8',
                                    type: "POST",
                                    data: JSON.stringify({
                                            userId: item.managerId,
                                            customerId: item.customerId,
                                            dateTime: that.getNowDate()
                                        }
                                    ),
                                    beforeSend: function (jqXHR) {
                                        $.xhrPool.push(jqXHR);
                                    }, complete: function (jqXHR) {
                                        var index = $.xhrPool.indexOf(jqXHR);
                                    },
                                    error: function () {
                                        console.log('error')
                                    },
                                    success: function (r) {
                                        var r = r.data.sendData
                                        intentionFlag = r.intentionFlag;
                                        if (intentionFlag == 0) {
                                            that.list[i].state = '今日新增';
                                        } else {
                                            that.list[i].state = '已更新';
                                        }
                                    },
                                })

                            } else {
                                that.list[i].state = "未更新"
                            }
                        }
                    }
                }
            },

            getNowDate: function () {
                var now = new Date();
                var year = now.getFullYear();
                var month = (now.getMonth() + 1).toString();
                var day = (now.getDate()).toString();
                var hour = (now.getHours()).toString();
                var minute = (now.getMinutes()).toString();
                var second = (now.getSeconds()).toString();
                if (month.length == 1) {
                    month = "0" + month;
                }
                if (day.length == 1) {
                    day = "0" + day;
                }
                if (hour.length == 1) {
                    hour = "0" + hour;
                }
                if (minute.length == 1) {
                    minute = "0" + minute;
                }
                if (second.length == 1) {
                    second = "0" + second;
                }
                var dateTime = year + "-" + month + "-" + day;
                return dateTime;
            },
            getBigRegionSaleTargetYc: function () {
                var that = this;
                $(".oaLoad").show();
                $.ajax({
                    url: server.ip + '/depConfig/getBigRegionSaleTargetYc.json',
                    contentType: 'application/json;charset=utf-8',
                    type: "POST",
                    data: JSON.stringify({
                        userId: getCurrentUser().id,
                        date: that.getNowDate(),
                        keyYc: that.keyYc,
                        buyDateYc: that.buyDateYc
                    }),
                    success: function (r) {
                        var r = r.data.sendData
                        that.allChance = 0;
                        that.overSevenChance = 0;
                        for (var i = 0; i < r.result.length; i++) {
                            var chanceNum = r.result[i].chance.length - 1;
                            if (r.result[i].buyDate == '本月内') {
                                if (r.result[i].chance != '<50%') {
                                    that.allChance = that.allChance + Number(r.result[i].chance.substring(0, chanceNum))
                                }
                                console.log(Number(r.result[i].chance.substring(0, chanceNum)))
                                if (Number(r.result[i].chance.substring(0, chanceNum)) >= 75) {
                                    that.overSevenChance = that.overSevenChance + Number(r.result[i].chance.substring(0, chanceNum))
                                }
                            }
                            /* r.result[i].todayOtherCondition = '';
                             r.result[i].yesterdayOtherCondition = '';*/
                            r.result[i].state = '';
                        }
                        //console.log(that.allChance, that.overSevenChance)

                        that.list = that.tablesMergeCell(r.result);
                        if (that.list && that.list.length > 0) {
                            for (var i = 0; i < that.list.length; i++) {
                                //that.getCustomerVisit(i);
                                that.isToday(i);
                            }
                        }
                        $(".oaLoad").hide();
                        that.finishSum = r.targetSale.finishSum;
                        that.targetSum = Number(r.targetSale.saleTarget);
                    },
                })
            }
        },
        mounted: function () {
            var that = this;

            that.getBigRegionSaleTargetYc();
            /*   $.wyui.postMethod('/depConfig/getBigRegionSaleTargetYc.json', {
                   userId: getCurrentUser().id,
                   date: that.getNowDate()
               }, function (r) {
                   console.log(r);
                   for (var i = 0; i < r.result.length; i++) {
                       var chanceNum = r.result[i].chance.length - 1
                       if (r.result[i].chance != '<50%') {
                           that.allChance = that.allChance + Number(r.result[i].chance.substring(0, chanceNum))
                       }
                       console.log(Number(r.result[i].chance.substring(0, chanceNum)))
                       if (Number(r.result[i].chance.substring(0, chanceNum)) >= 75) {
                           that.overSevenChance = that.overSevenChance + Number(r.result[i].chance.substring(0, chanceNum))
                       }
                       r.result[i].todayOtherCondition = '';
                       r.result[i].yesterdayOtherCondition = '';
                       r.result[i].state = '';
                   }
                   console.log(that.allChance, that.overSevenChance)
                   that.list = that.tablesMergeCell(r.result);
                   if (that.list && that.list.length > 0) {
                       for (var i = 0; i < that.list.length; i++) {
                           that.getCustomerVisit(i);
                           that.isToday(i);
                       }
                   }
                   that.finishSum = r.targetSale.finishSum
                   that.targetSum = r.targetSale.targetSum
               }, true);*/
        }
    });
</script>
<script>
    //初始化FixedTable
    $(".fixed-table-box").fixedTable();
</script>
</body>
</html>